﻿using System;
using System.IO;

namespace mvcForum.Core.Interfaces.Services {

	public interface IAttachmentService {
		/// <summary>
		/// Attach the file in the given stream on the given topic.
		/// </summary>
		/// <param name="author">The attachment's owner</param>
		/// <param name="topic">The topic to which the file will be attached</param>
		/// <param name="filename">Name of the attachment</param>
		/// <param name="contentType">Content type of the attachment</param>
		/// <param name="length">Length, in bytes, of the attachment</param>
		/// <param name="stream">The input stream</param>
		/// <returns>Status code</returns>
		AttachStatusCode AttachFile(ForumUser author, Topic topic, String filename, String contentType, Int32 length, Stream stream);
		/// <summary>
		/// Attach the file in the given stream on the given post.
		/// </summary>
		/// <param name="author">The attachment's owner</param>
		/// <param name="post">The post to which the file will be attached</param>
		/// <param name="filename">Name of the attachment</param>
		/// <param name="contentType">Content type of the attachment</param>
		/// <param name="length">Length, in bytes, of the attachment</param>
		/// <param name="stream">The input stream</param>
		/// <returns>Status code</returns>
		AttachStatusCode AttachFile(ForumUser author, Post post, String filename, String contentType, Int32 length, Stream stream);
		/// <summary>
		/// Get the amount of space used for attachments by the given user.
		/// </summary>
		/// <param name="user">The user in question</param>
		/// <returns>The sum of the sizes of all attachments uploaded by the given user</returns>
		Int32 GetSpaceUsed(ForumUser user);
	}
}